package com.hzw.saas.web.admin.hpc.param;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 *
 * </p>
 *
 * @author sonam
 * @since 2021/2/22 17:14
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
public class HpcItemParam {

    @NotBlank(message = "HPC商品名称不能为空")
    @ApiModelProperty(value = "HPC商品名称")
    private String itemName;

    @NotNull(message = "核时不能为空")
    @Min(message = "核时不能小于1", value = 1)
    @ApiModelProperty(value = "核时")
    private Long coreTime;

    @NotNull(message = "有效期不能为空")
    @Min(message = "有效期不能小于1", value = 1)
    @ApiModelProperty(value = "时间数量", notes = "有效期")
    private Long datePeriod;

    @Pattern(regexp = "^(D|M|S|Y)$", message = "请输入正确的时间单位,D/M/S/Y")
    @ApiModelProperty(value = "时间单位", notes = "有效期单位,D/M/S/Y")
    private String dateUnit;

    @Min(message = "价格不能小于1", value = 1)
    @ApiModelProperty(value = "价格")
    private Double price;

    @ApiModelProperty(value = "优惠价", notes = "默认0")
    private Double priceDiscount;

}
